package com.example.demo.controller;

import java.util.concurrent.CopyOnWriteArraySet;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.pojo.Comment;
import com.example.demo.pojo.User;
import com.example.demo.service.CommentService;
import com.example.demo.service.UserService;

@RestController
@RequestMapping(value = "/action")
public class ActionManage {
	
	public static CopyOnWriteArraySet<String> ips = new CopyOnWriteArraySet<String>();

	@Autowired
	CommentService commentService;
	@Autowired
	UserService userService;
	
	@RequestMapping("/addComment")
	@ResponseBody
	public String addComment(@RequestBody String content) {
		System.out.println(content);
		Comment comment = new Comment();
		comment.setContent(content);
		commentService.add(comment);
		return "success";
	}
	
}
